package com.example.liteflow.bol;

import com.yomahub.liteflow.annotation.LiteflowComponent;
import com.yomahub.liteflow.core.NodeBooleanComponent;
import com.yomahub.liteflow.slot.Slot;
import java.util.Map;
import lombok.extern.slf4j.Slf4j;

/**
 * @author chen.an
 * @date 2024-08-20 20:49
 */
@Slf4j
@LiteflowComponent(id = "If2", name = "判断（age>10）")
public class IfNode2 extends NodeBooleanComponent {
    @Override
    public boolean processBoolean() throws Exception {
        Slot slot = this.getSlot();
        int age = slot.getRequestData();
        log.info("If2 节点组件【{}】-BooleanNode,获取数据：{}", Thread.currentThread().threadId(), age);
        slot.setRequestData(Map.of("If2", "If2"));
        return age > 10;
    }
}
